1. Field of the Invention
The present invention relates to processors, and more particularly, to detecting program hazards in processors with unprotected pipelines.
2. Background
Computer applications today incorporate complex mathematical operations that are performance critical. Many image and speech processing applications perform complex mathematical functions, for example, filtering in real time. Typically, such applications use a digital signal processor (DSP) that implements instructions useful and efficient in digital signal processing. An example of a DSP is the TMS320 series of DSPs available from Texas Instruments®. Various DSPs and other embedded chips are also provided by Conexant Inc.®.
To meet stringent power and performance objectives, the DSPs are often designed with “open” or “unprotected” pipelines. Such unprotected pipelines produce unpredictable results (referred to herein as “hazards” and include static stalls) when computer-executable code is executed by a DSP (or any other processor that is designed with such unprotected pipelines). This is in contrast to most desktop personal computer processors (e.g. the Pentium® class processor from Intel Corp.) that use extra circuitry to protect from such hazards.
Hazards may be grouped into two categories, static and dynamic. Static hazards involve program sequences, while dynamic (or run-time) hazards involve actual data values.
Software (or firmware) programmers use assembly language to write programs. Such programs must avoid program sequences that may result in hazards. Typically, the list of program sequence instructions can be very long and complex. One must analyze every line of code to avoid hazards, which can be very tedious and expensive.
One conventional technique to avoid hazards has been program simulation. Simulation can detect hazards along specific paths of data sets provided to the simulated program. However, exhaustive checking of all combinations of possible executable paths with all possible data values is tedious and expensive, and is not acceptable as a viable commercial solution.
Therefore, there is a need for a system and method that allows programmers to evaluate program sequences and avoid hazards, both static and dynamic, in processors with unprotected pipelines.